from flask import Blueprint
from . import view  # 假设你的视图函数在view模块中

# 创建蓝图
userAnswer_bluePrint = Blueprint('userAnswer_bluePrint', __name__)

# 注册路由
# 添加用户答案
userAnswer_bluePrint.add_url_rule(rule='/add', methods=['POST'], view_func=view.addUserAnswer)
# 删除用户答案
userAnswer_bluePrint.add_url_rule(rule='/delete', methods=['DELETE'], view_func=view.deleteUserAnswer)
# 更新用户答案（仅管理员）
userAnswer_bluePrint.add_url_rule(rule='/update', methods=['POST'], view_func=view.updateUserAnswer)
# 获取用户答案（通过ID）
userAnswer_bluePrint.add_url_rule(rule='/getById', methods=['GET'], view_func=view.getUserAnswerVOById)
# 分页获取用户答案列表（仅管理员）
userAnswer_bluePrint.add_url_rule(rule='/listByPage', methods=['POST'], view_func=view.listUserAnswerByPage)
# 分页获取用户答案列表封装类
userAnswer_bluePrint.add_url_rule(rule='/listVOByPage', methods=['POST'], view_func=view.listUserAnswerVOByPage)
# 分页获取当前用户自己的答案列表
userAnswer_bluePrint.add_url_rule(rule='/listMyByPage', methods=['POST'], view_func=view.listMyUserAnswerByPage)
# 编辑用户答案
userAnswer_bluePrint.add_url_rule(rule='/edit', methods=['PATCH'], view_func=view.editUserAnswer)